package com.ymh.dao;

import com.ymh.domain.RoleResourceDO;
import com.ymh.domain.UserDO;
import java.util.List;
import javax.persistence.criteria.CriteriaBuilder.In;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @author: 13590
 * @date: 2020/11/7 15:15
 * @description:
 */

public interface RoleResourceDAO extends JpaRepository<RoleResourceDO, Integer> {


  @Query(value = "select r.url from role_resource rr  left join resource r on rr.resource_id = r.id "
      + "where rr.role_id in (:roleIds)", nativeQuery = true)
  List<String> getResourceUrlByRoleId(@Param("roleIds") List<Integer> roleIds);

}
